<?php 
/**
 * NOTICE OF LICENSE
 *
 * THIS SOURCE FILE IS PART OF EVEBIT'S PRIVATE PROJECT.
 * 
 * DO NOT USE THIS FILE IN OTHER PLACE.
 *
 * @package     App_Backend
 * @subpackage  View
 * @author      Cheng Wei <berlios.o@gmail.com>
 * @version     $$Id: index.phtml 20 2010-12-18 09:35:07Z cheng.wei $$
 */



/* @var $data Backend_ConfigurationController */
$data    = $this->state;
$filters = $data["filters"];
$sort    = $data["sort"];
$tableImage="15_48x48.png";
$tableTitle=$this->__("Site Configuration");
$viewAction="configuration";
$this->module = 'default/';

$this->headTitle($this->__($tableTitle.' Management'));
/* @var $paginator Zend_Paginator */
$paginator = $this->paginator;
?>


<?php $this->placeholder('grid-content')->captureStart('SET') ?>
	<?php foreach($paginator as $item):?>
        <tr title="<?php echo $item->getName()?>" >    						           
            <td ><?php echo $item->getTitle()?></td>
            <td >
            <?php 
            	$value = $item->getValue();
				$input = $item->getInput();
				switch ($input) { 
					case 'select':
				    	$options = $item->getOptionsArray();
				    	if (isset($options[$value])) {
				    		echo $options[$value];
				    	}
						break;
					default:
						echo $value;
				}
			?>
            </td>        	           		        	            	        	            
            <td >
	            <a class="button tooltip" href="<?php echo $this->baseUrl('/default/configuration/edit/id/'.$item->getId())?>">
	               <?php echo $this->__("Edit") ?>
	            </a>
            </td>		
       </tr>
   <?php endforeach; ?>
<?php $this->placeholder('grid-content')->captureEnd() ?>

<?php echo $this->action(
		'render', 'block', 'blocks',
		array(
			'template'=>'grid',
			'grid'=>'config',
			'state'=>$this->state,
			'tableShortTitle'=>$tableTitle,
		    'tableImage'=>$tableImage,
		    'viewAction'=>$viewAction,
			'paginator'=>$paginator,
			'buttons'=>array(),			
			'showfilter'=>false,
		    'showmassactions'=>false,		    
			'colnums'=>array(				
				'title' => $this->__('Title'),
				'value' => $this->__('Value'),				
				'action' => $this->__('Action'),
				),
			'action'=> $this->baseUrl('backend/configuration'),
			'content'=> $this->placeholder('grid-content'),
		)
	) ?>  
